package com.yuwenxin.bean;

import com.yuwenxin.core.AuxiliaryTool;

import java.util.Date;

public class Comment {
    private int id;
    private String context;
    private Date commentTime;

    // 两个外键
    private int commentMusicId, commentUserId;
    private User poster;
    private Music commentedMusic;

    public int getCommentMusicId() {
        return commentMusicId;
    }

    public void setCommentMusicId(int commentMusicId) {
        this.commentMusicId = commentMusicId;
    }

    public int getCommentUserId() {
        return commentUserId;
    }

    public void setCommentUserId(int commentUserId) {
        this.commentUserId = commentUserId;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Date getCommentTime() {
        return commentTime;
    }

    public void setCommentTime(Date commentTime) {
        this.commentTime = commentTime;
    }

    public User getPoster() {
        return poster;
    }

    public void setPoster(User poster) {
        this.poster = poster;
    }

    public Music getCommentedMusic() {
        return commentedMusic;
    }

    public void setCommentedMusic(Music commentedMusic) {
        this.commentedMusic = commentedMusic;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", context='" + context + '\'' +
                ", commentTime=" + AuxiliaryTool.dateToString(commentTime) +
                ", commentMusicId=" + commentMusicId +
                ", commentUserId=" + commentUserId +
                ", poster=" + poster +
                ", commentedMusic=" + commentedMusic +
                '}';
    }
}
